package dk.mirasola.systemtraining.bridgewidgets.client.ui.distributionfiltereditor;

import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.Editor;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Widget;
import dk.mirasola.systemtraining.bridgewidgets.client.ui.editor.CompareOperatorEditor;
import dk.mirasola.systemtraining.bridgewidgets.client.ui.editor.IntegerEditor;
import dk.mirasola.systemtraining.bridgewidgets.client.ui.editor.SeatsEditor;
import dk.mirasola.systemtraining.bridgewidgets.client.ui.editor.SuitsEditor;
import dk.mirasola.systemtraining.bridgewidgets.shared.model.distributionfiltertree.FitDistributionFilter;

public class FitDistributionFilterEditor extends Composite implements Editor<FitDistributionFilter> {
    interface FitDistributionFilterEditorUiBinder extends UiBinder<Widget, FitDistributionFilterEditor> {
    }

    private static FitDistributionFilterEditorUiBinder uiBinder = GWT.create(FitDistributionFilterEditorUiBinder.class);

    @UiField
    SeatsEditor seatsEditor;
    @UiField
    SuitsEditor suitsEditor;
    @UiField
    IntegerEditor totalCardsEditor;
    @UiField
    CompareOperatorEditor comparatorEditor;
    @UiField
    CheckBox invertedEditor;
    @UiField(provided = true)
    HorizontalPanel totalCardEditorPanel;

    public FitDistributionFilterEditor() {
        totalCardEditorPanel = new HorizontalPanel();
        totalCardEditorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        initWidget(uiBinder.createAndBindUi(this));
    }
}
